{{- if (.Get 0) -}}

    {{ $file := (.Get 0) }}
    {{ $lang := (.Get 1) }}

    {{ with ($lang) }}{{ $lang = (printf "language-%s" (.)) }}{{ end }}
    {{ $id := (printf "sc-%s-%s" (.Name) (delimit (shuffle (seq 999)) "" | md5)) }}

    <div class="shortcode shortcode-{{ ($.Name) }} mb-3">
      <div class="card">
        <div class="card-header">
          <div class="d-flex align-items-center">
            <div class="flex-shrink-0">
              <i class="fas fa-file-code fa-fw"></i>
            </div>
            <div class="flex-grow-1 mx-2">
              <code>{{ ($file) }}</code>
            </div>
            <div class="flex-shrink-0">
              <ul class="list-inline mb-0">
                <li class="list-inline-item" data-bs-tooltip data-bs-title='{{ (i18n "sc.codebox.copy") }}'>
                  <a class="text-body-secondary" href="#"
                     data-fn="clipboard preventDefault" data-clipboard-target="#{{ ($id) }}"
                     role="button">
                    <i class="fas fa-copy fa-fw"></i>
                  </a>
                </li>
              </ul>
            </div>
          </div>
        </div>
        <div class="card-body">
          <pre class="mb-0"><code id="{{ ($id) }}" class="{{ ($lang) }}">{{ with (.Inner) }}{{ (((trim . "\n\r") | htmlEscape) | safeHTML) }}{{ end }}</code></pre>
        </div>
      </div>
    </div>

{{- else -}}

    {{ (partial "alerts/no_params" .) }}

{{- end -}}
